home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok18.lha
/
Profile
/
Demos
/
Prim1.pro
< prev
next >
Wrap
Text File
|
1993-08-15
|
407b
|
25 lines
MODULE Prim1;
FROM InOut IMPORT WriteInt;
CONST n = 1000;
VAR i,k: INTEGER;
(* k: min = 2, max = 999 *)
(* i: min = 2, max = 1000 *)
prim: BOOLEAN;
(* prim: min = 0, max = 1 *)
BEGIN
FOR i:=2 TO n DO
(* 999 Durchläufe *)
prim := TRUE;
FOR k:=2 TO i-1 DO
(* 498501 Durchläufe *)
IF i MOD k = 0 THEN prim := FALSE END;
END;
IF prim THEN WriteInt(i,4) END;
END;
END Prim1.